const otherPage = [
	{
		"path": "pages/other/about_us", //关于我们
		"style": {}
	}, {
		"path": "pages/other/set", //个人设置
		"style": {}
	}, {
		"path": "pages/other/notice", //平台公告
		"style": {}
	}, {
		"path": "pages/other/external_page", //网页链接
		"style": {}
	}, {
		"path": "pages/other/address", //地址管理
		"style": {}
	}, {
		"path": "pages/other/address_info", //地址管理-新增编辑
		"style": {}
	}, {
		"path": "pages/other/document", //文档详情
		"style": {}
	}, {
		"path": "pages/other/ad_info", //广告图片
		"style": {}
	}
]
const loginPage = [
	{
		"path": "pages/login/login_psd", //密码登陆
		"style": {}
	}, {
		"path": "pages/login/find_psd", //找回/修改密码
		"style": {}
	}, {
		"path": "pages/login/find_pay_psd", //修改-支付密码
		"style": {}
	}, {
		"path": "pages/login/register", //注册
		"style": {}
	}
]
const minePage = [
	{
		"path": "pages/mine/index", //我的
		"style": {}
	}, {
		"path": "pages/mine/team", //我的团队
		"style": {}
	}, {
		"path": "pages/mine/info", //个人信息
		"style": {}
	}, {
		"path": "pages/mine/invite", //邀请
		"style": {}
	}, {
		"path": "pages/mine/log", //日志
		"style": {}
	}, {
		"path": "pages/mine/realname", //实名认证
		"style": {}
	}
]
module.exports = (pagesJson) => {

	const appPages = [
		{
			"path": "pages/home/index", //首页
			"style": {}
		},
		...loginPage,
		...otherPage,
		...minePage,
		{
			"path": "pages/index/index", //首页
			"style": {}
		},
		{
			"path": "pages/goods/list", //商品列表
			"style": {}
		},
		{
			"path": "pages/index/good_info", //商品详情
			"style": {}
		},
		{
			"path": "pages/index/good_order", //商品下订单
			"style": {}
		},
		{
			"path": "pages/ecology/index", //生态
			"style": {}
		},
		{
			"path": "pages/panic_buy/index", //秒购
			"style": {}
		},
		{
			"path": "pages/order/index", //订单
			"style": {}
		},
		{
			"path": "pages/mine/wallet", //我的钱包
			"style": {}
		},
		{
			"path": "pages/mine/send", //我的钱包-赠送
			"style": {}
		},
		{
			"path": "pages/mine/switch", //我的钱包-兑换
			"style": {}
		},
		{
			"path": "pages/mine/service", //业务管理
			"style": {}
		},
		{
			"path": "pages/mine/bind_account", //账户绑定
			"style": {}
		},
		{
			"path": "pages/mine/trade", //提现
			"style": {}
		},
		//  大逃杀 game相关
		{
			"path": "pages/gameDts/page/game",
			"style": {
				"navigationBarTitleText": "",
				"navigationStyle": "custom"
			}
		}, {
			"path": "pages/gameDts/page/record",
			"style": {
				"navigationBarTitleText": "",
				"navigationStyle": "custom"
			}
		}, {
			"path": "pages/gameDts/page/record_more",
			"style": {
				"navigationBarTitleText": "",
				"navigationStyle": "custom"
			}
		}, {
			"path": "pages/gameDts/page/rank_list",
			"style": {
				"navigationBarTitleText": "",
				"navigationStyle": "custom"
			}
		}, {
			"path": "pages/gameDts/page/rule",
			"style": {
				"navigationBarTitleText": "",
				"navigationStyle": "custom"
			}
		}
	];

	const pcPages = [{
		"path": "pages/login/register", //注册
		"style": {}
	}, {
		"path": "pages/other/document", //文档
		"style": {}
	}, {
		"path": "pages/other/ad_info", //广告图片
		"style": {}
	}];

	let nowpages = [];
	if (process.env.VUE_APP_PLATFORM == 'h5') {
		console.log(process.env.NODE_ENV);
		if (process.env.NODE_ENV == 'development') {
			nowpages = appPages.concat(pcPages);
		} else {
			nowpages = pcPages;
		}
	} else if (process.env.VUE_APP_PLATFORM == 'app-plus') {
		nowpages = appPages;
	}
	nowpages.forEach(li => {
		li.style['app-plus'] = {
			"bounce": "none", //关闭窗口回弹效果
		}
	})
	// console.log('nowpages:P', nowpages);

	return {
		// 合并pages.json的内容  
		pages: nowpages,
		"globalStyle": {
			"titleNView": false,
			"navigationBarTitleText": "众旺通",
			"navigationBarTextStyle": "black"
		},
		"tabBar": {
			"color": "#C8C8C8",
			"selectedColor": "#333333",
			"borderStyle": "white",
			"backgroundColor": "#ffffff",
			"list": [{
				"pagePath": "pages/home/index",
				"iconPath": "static/tabbar/img_1.png",
				"selectedIconPath": "static/tabbar/img_1.png",
				"text": "首页"
			},
			{
				"pagePath": "pages/ecology/index",
				"iconPath": "static/tabbar/img_1.png",
				"selectedIconPath": "static/tabbar/img_1.png",
				"text": "生态"
			},
			{
				"pagePath": "pages/panic_buy/index",
				"iconPath": "static/tabbar/img_5.png",
				"selectedIconPath": "static/tabbar/img_6.png",
				"text": "秒购"
			},
			{
				"pagePath": "pages/order/index",
				"iconPath": "static/tabbar/img_7.png",
				"selectedIconPath": "static/tabbar/img_8.png",
				"text": "订单"
			},
			{
				"pagePath": "pages/mine/index",
				"iconPath": "static/tabbar/img_1.png",
				"selectedIconPath": "static/tabbar/img_1.png",
				"text": "我的"
			}]
		},
		"easycom": {
			"^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)": "uni_modules/z-paging/components/z-paging$1/z-paging$1.vue"
		}
	}
}